<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>PintarOS: include/hal.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">PintarOS
   </div>
   <div id="projectbrief">Operating System for Smart Card</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">hal.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Header file for HAL (Hardware Abstraction Layer)  
<a href="#details">More...</a></p>

<p><a href="hal_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a345d4bf6e67fe2036ee84560373dafb7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a345d4bf6e67fe2036ee84560373dafb7"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HAL_OK</b>&#160;&#160;&#160;0</td></tr>
<tr class="separator:a345d4bf6e67fe2036ee84560373dafb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b8da8910a639a391c7c6f385fdc819b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3b8da8910a639a391c7c6f385fdc819b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>HAL_ERROR</b>&#160;&#160;&#160;1</td></tr>
<tr class="separator:a3b8da8910a639a391c7c6f385fdc819b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad106c3e360fec68aef9cc2da8bcb4064"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#ad106c3e360fec68aef9cc2da8bcb4064">HAL_Init</a> ()</td></tr>
<tr class="memdesc:ad106c3e360fec68aef9cc2da8bcb4064"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize Hardware.  <a href="#ad106c3e360fec68aef9cc2da8bcb4064">More...</a><br/></td></tr>
<tr class="separator:ad106c3e360fec68aef9cc2da8bcb4064"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a136930f47e2cdb4cdd6bc147b9703b0f"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a136930f47e2cdb4cdd6bc147b9703b0f">HAL_IO_RxByte</a> ()</td></tr>
<tr class="memdesc:a136930f47e2cdb4cdd6bc147b9703b0f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receive 1 byte data.  <a href="#a136930f47e2cdb4cdd6bc147b9703b0f">More...</a><br/></td></tr>
<tr class="separator:a136930f47e2cdb4cdd6bc147b9703b0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e86724251ff7e04917713b3e0d3eeaf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a5e86724251ff7e04917713b3e0d3eeaf">HAL_IO_TxByte</a> (uint8_t ch)</td></tr>
<tr class="memdesc:a5e86724251ff7e04917713b3e0d3eeaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transmit 1 byte data.  <a href="#a5e86724251ff7e04917713b3e0d3eeaf">More...</a><br/></td></tr>
<tr class="separator:a5e86724251ff7e04917713b3e0d3eeaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2a2216471be84d032a09559ed0b97cac"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a2a2216471be84d032a09559ed0b97cac">HAL_Mem_ReadByte</a> (uint16_t address)</td></tr>
<tr class="memdesc:a2a2216471be84d032a09559ed0b97cac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read 1 byte data.  <a href="#a2a2216471be84d032a09559ed0b97cac">More...</a><br/></td></tr>
<tr class="separator:a2a2216471be84d032a09559ed0b97cac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab846f676e7ae737a96a974da5c8dd558"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#ab846f676e7ae737a96a974da5c8dd558">HAL_Mem_WriteByte</a> (uint16_t address, uint8_t databyte)</td></tr>
<tr class="memdesc:ab846f676e7ae737a96a974da5c8dd558"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write 1 byte data.  <a href="#ab846f676e7ae737a96a974da5c8dd558">More...</a><br/></td></tr>
<tr class="separator:ab846f676e7ae737a96a974da5c8dd558"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48d7225f3720aa598e5c9fc3354c88e8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#a48d7225f3720aa598e5c9fc3354c88e8">HAL_Mem_ReadBlock</a> (uint16_t address, uint16_t size, uint8_t *databyte)</td></tr>
<tr class="memdesc:a48d7225f3720aa598e5c9fc3354c88e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read block of data.  <a href="#a48d7225f3720aa598e5c9fc3354c88e8">More...</a><br/></td></tr>
<tr class="separator:a48d7225f3720aa598e5c9fc3354c88e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aebb1592b9bb339c20a2e28a08b3deebe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#aebb1592b9bb339c20a2e28a08b3deebe">HAL_Mem_WriteBlock</a> (uint16_t address, uint16_t size, uint8_t *databyte)</td></tr>
<tr class="memdesc:aebb1592b9bb339c20a2e28a08b3deebe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write block of data.  <a href="#aebb1592b9bb339c20a2e28a08b3deebe">More...</a><br/></td></tr>
<tr class="separator:aebb1592b9bb339c20a2e28a08b3deebe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2c545801a4158cd4d1967ea8a4a22be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hal_8h.html#ae2c545801a4158cd4d1967ea8a4a22be">HAL_RND_GetBlock</a> (uint8_t *buf)</td></tr>
<tr class="memdesc:ae2c545801a4158cd4d1967ea8a4a22be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate Pseudo Random Numbers.  <a href="#ae2c545801a4158cd4d1967ea8a4a22be">More...</a><br/></td></tr>
<tr class="separator:ae2c545801a4158cd4d1967ea8a4a22be"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Header file for HAL (Hardware Abstraction Layer) </p>
<dl class="section author"><dt>Author</dt><dd>Ricky Hariady (<a href="#" onclick="location.href='mai'+'lto:'+'ric'+'ky'+'.ha'+'ri'+'ady'+'@e'+'nte'+'r.'+'web'+'.i'+'d'; return false;">ricky<span style="display: none;">.nosp@m.</span>.har<span style="display: none;">.nosp@m.</span>iady@<span style="display: none;">.nosp@m.</span>ente<span style="display: none;">.nosp@m.</span>r.web<span style="display: none;">.nosp@m.</span>.id</a>)</dd></dl>
<dl class="section date"><dt>Date</dt><dd>7/10/2013 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ad106c3e360fec68aef9cc2da8bcb4064"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_Init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize Hardware. </p>
<dl class="section return"><dt>Returns</dt><dd>Result<br/>
 Success = HAL_OK<br/>
 Not Success = HAL_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="a136930f47e2cdb4cdd6bc147b9703b0f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t HAL_IO_RxByte </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Receive 1 byte data. </p>
<p>Receive 1 byte data from from serial IO</p>
<dl class="section return"><dt>Returns</dt><dd>the data byte received </dd></dl>

</div>
</div>
<a class="anchor" id="a5e86724251ff7e04917713b3e0d3eeaf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HAL_IO_TxByte </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>ch</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Transmit 1 byte data. </p>
<p>Transmit 1 byte data to serial IO</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>data byte to transmit </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a48d7225f3720aa598e5c9fc3354c88e8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_Mem_ReadBlock </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>databyte</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read block of data. </p>
<p>Read block of data from non-volatile memory (EEPROM/Flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of beginning of memory want to read </td></tr>
    <tr><td class="paramname">size</td><td>size of data to be read </td></tr>
    <tr><td class="paramname">databyte</td><td>address where the readed data to be saved </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data readed </dd></dl>

</div>
</div>
<a class="anchor" id="a2a2216471be84d032a09559ed0b97cac"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t HAL_Mem_ReadByte </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read 1 byte data. </p>
<p>Read 1 byte data from non-volatile memory (EEPROM/Flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of memory want to read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the data byte readed </dd></dl>

</div>
</div>
<a class="anchor" id="aebb1592b9bb339c20a2e28a08b3deebe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HAL_Mem_WriteBlock </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>databyte</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write block of data. </p>
<p>write block of data to non-volatile memory (EEPROM/Flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of beginning of memory want to read </td></tr>
    <tr><td class="paramname">size</td><td>size of data to be write </td></tr>
    <tr><td class="paramname">databyte</td><td>address where the data to be write are saved </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>data wrote </dd></dl>

</div>
</div>
<a class="anchor" id="ab846f676e7ae737a96a974da5c8dd558"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HAL_Mem_WriteByte </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>databyte</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write 1 byte data. </p>
<p>Write 1 byte data to non-volatile memory (EEPROM/flash)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>virtual address of memory want to write </td></tr>
    <tr><td class="paramname">databyte</td><td>the data to be write </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ae2c545801a4158cd4d1967ea8a4a22be"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HAL_RND_GetBlock </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buf</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Generate Pseudo Random Numbers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>address where the pseudo random numbers to be saved </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jun 4 2014 18:13:31 for PintarOS by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
